import request from '@/utils/request'

// 查询回收商品管理列表
export function listGoods(query) {
  return request({
    url: '/recovery/goods/list',
    method: 'get',
    params: query
  })
}

export function listRecordGoods(query) {
  return request({
    url: 'recovery/goods/record/list',
    method: 'get',
    params: query
  })
}

export function listTransferGoods(query) {
  return request({
    url: '/recovery/goods/transfer/list',
    method: 'get',
    params: query
  })
}

// 查询回收商品管理列表
export function voidListGoods(query) {
  return request({
    url: '/recovery/goods/void/list',
    method: 'get',
    params: query
  })
}

// 查询回收商品管理详细
export function getGoods(goodsId) {
  return request({
    url: '/recovery/goods/' + goodsId,
    method: 'get'
  })
}

/*正常状态的商品*/
export function getGoodsNormal(goodsId) {
  return request({
    url: '/recovery/goods/normal/detail',
    method: 'get',
    params: {goodsId: goodsId}
  })
}

// 修改回收商品管理
export function updateGoods(data) {
  return request({
    url: '/recovery/goods',
    method: 'put',
    data: data
  })
}

export function testUpdateGoods(data) {
  return request({
    url: '/recovery/goods/test/update',
    method: 'put',
    data : data
  })
}

export function quotationUpdateGoods(data) {
  return request({
    url: '/recovery/goods/quotation/update',
    method: 'put',
    data : data
  })
}

// 删除回收商品管理
export function delGoods(goodsId) {
  return request({
    url: '/recovery/goods/' + goodsId,
    method: 'delete'
  })
}

// 导出回收商品管理
export function exportGoods(query) {
  return request({
    url: '/recovery/goods/export',
    method: 'get',
    params: query
  })
}

export function addGoodsRecord(type, goodsId){
  return request({
    url: '/recovery/goods/add/record',
    method:'post',
    data: {type: type, goodsId: goodsId}
  })
}

//获取入库成本分布
export function queryChatDataCostPrice(){
  return request({
    url: '/recovery/goods/chatDataCostPrice',
    method:'get'
  })
}

//获取成色分布
export function queryChatDataFineness(){
  return request({
    url: '/recovery/goods/chatDataFineness',
    method:'get'
  })
}

//获取成色分布
export function queryChatDataBrand(){
  return request({
    url: '/recovery/goods/chatDataBrand',
    method:'get'
  })
}

export function querySaleAndCost7(query){
  return request({
    url: '/recovery/goods/saleAndCost7',
    method:'get',
    params: query
  })
}

export function queryIndexData(query){
  return request({
    url: '/recovery/goods/queryIndexData',
    method:'get',
    params: query
  })
}
